{"ast":null,"code":"var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport VerticalAlignTopOutlined from \"@ant-design/icons/es/icons/VerticalAlignTopOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport React, { memo, useContext, useEffect, useRef, useState } from 'react';\nimport FloatButton, { floatButtonPrefixCls } from './FloatButton';\nimport { ConfigContext } from '../config-provider';\nimport getScroll from '../_util/getScroll';\nimport scrollTo from '../_util/scrollTo';\nimport throttleByAnimationFrame from '../_util/throttleByAnimationFrame';\nimport FloatButtonGroupContext from './context';\nimport useStyle from './style';\nconst BackTop = props => {\n  const {\n      prefixCls: customizePrefixCls,\n      className = '',\n      type = 'default',\n      shape = 'circle',\n      visibilityHeight = 400,\n      icon = /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null),\n      target,\n      onClick,\n      duration = 450\n    } = props,\n    restProps = __rest(props, [\"prefixCls\", \"className\", \"type\", \"shape\", \"visibilityHeight\", \"icon\", \"target\", \"onClick\", \"duration\"]);\n  const [visible, setVisible] = useState(visibilityHeight === 0);\n  const ref = useRef(null);\n  const getDefaultTarget = () => ref.current && ref.current.ownerDocument ? ref.current.ownerDocument : window;\n  const handleScroll = throttleByAnimationFrame(e => {\n    const scrollTop = getScroll(e.target, true);\n    setVisible(scrollTop >= visibilityHeight);\n  });\n  useEffect(() => {\n    const getTarget = target || getDefaultTarget;\n    const container = getTarget();\n    handleScroll({\n      target: container\n    });\n    container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);\n    return () => {\n      handleScroll.cancel();\n      container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);\n    };\n  }, [target]);\n  const scrollToTop = e => {\n    scrollTo(0, {\n      getContainer: target || getDefaultTarget,\n      duration\n    });\n    onClick === null || onClick === void 0 ? void 0 : onClick(e);\n  };\n  const {\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const [wrapSSR] = useStyle(prefixCls);\n  const groupShape = useContext(FloatButtonGroupContext);\n  const mergeShape = groupShape || shape;\n  const contentProps = Object.assign({\n    prefixCls,\n    icon,\n    type,\n    shape: mergeShape\n  }, restProps);\n  return wrapSSR( /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: visible,\n    motionName: `${rootPrefixCls}-fade`\n  }, _ref => {\n    let {\n      className: motionClassName\n    } = _ref;\n    return /*#__PURE__*/React.createElement(FloatButton, Object.assign({\n      ref: ref\n    }, contentProps, {\n      onClick: scrollToTop,\n      className: classNames(className, motionClassName)\n    }));\n  }));\n};\nexport default /*#__PURE__*/memo(BackTop);","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","VerticalAlignTopOutlined","classNames","CSSMotion","React","memo","useContext","useEffect","useRef","useState","FloatButton","floatButtonPrefixCls","ConfigContext","getScroll","scrollTo","throttleByAnimationFrame","FloatButtonGroupContext","useStyle","BackTop","props","prefixCls","customizePrefixCls","className","type","shape","visibilityHeight","icon","createElement","target","onClick","duration","restProps","visible","setVisible","ref","getDefaultTarget","current","ownerDocument","window","handleScroll","scrollTop","getTarget","container","addEventListener","cancel","removeEventListener","scrollToTop","getContainer","getPrefixCls","rootPrefixCls","wrapSSR","groupShape","mergeShape","contentProps","assign","motionName","_ref","motionClassName"],"sources":["/data/messenger.client/node_modules/antd/es/float-button/BackTop.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport VerticalAlignTopOutlined from \"@ant-design/icons/es/icons/VerticalAlignTopOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport React, { memo, useContext, useEffect, useRef, useState } from 'react';\nimport FloatButton, { floatButtonPrefixCls } from './FloatButton';\nimport { ConfigContext } from '../config-provider';\nimport getScroll from '../_util/getScroll';\nimport scrollTo from '../_util/scrollTo';\nimport throttleByAnimationFrame from '../_util/throttleByAnimationFrame';\nimport FloatButtonGroupContext from './context';\nimport useStyle from './style';\nconst BackTop = props => {\n  const {\n      prefixCls: customizePrefixCls,\n      className = '',\n      type = 'default',\n      shape = 'circle',\n      visibilityHeight = 400,\n      icon = /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null),\n      target,\n      onClick,\n      duration = 450\n    } = props,\n    restProps = __rest(props, [\"prefixCls\", \"className\", \"type\", \"shape\", \"visibilityHeight\", \"icon\", \"target\", \"onClick\", \"duration\"]);\n  const [visible, setVisible] = useState(visibilityHeight === 0);\n  const ref = useRef(null);\n  const getDefaultTarget = () => ref.current && ref.current.ownerDocument ? ref.current.ownerDocument : window;\n  const handleScroll = throttleByAnimationFrame(e => {\n    const scrollTop = getScroll(e.target, true);\n    setVisible(scrollTop >= visibilityHeight);\n  });\n  useEffect(() => {\n    const getTarget = target || getDefaultTarget;\n    const container = getTarget();\n    handleScroll({\n      target: container\n    });\n    container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);\n    return () => {\n      handleScroll.cancel();\n      container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);\n    };\n  }, [target]);\n  const scrollToTop = e => {\n    scrollTo(0, {\n      getContainer: target || getDefaultTarget,\n      duration\n    });\n    onClick === null || onClick === void 0 ? void 0 : onClick(e);\n  };\n  const {\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const [wrapSSR] = useStyle(prefixCls);\n  const groupShape = useContext(FloatButtonGroupContext);\n  const mergeShape = groupShape || shape;\n  const contentProps = Object.assign({\n    prefixCls,\n    icon,\n    type,\n    shape: mergeShape\n  }, restProps);\n  return wrapSSR( /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: visible,\n    motionName: `${rootPrefixCls}-fade`\n  }, _ref => {\n    let {\n      className: motionClassName\n    } = _ref;\n    return /*#__PURE__*/React.createElement(FloatButton, Object.assign({\n      ref: ref\n    }, contentProps, {\n      onClick: scrollToTop,\n      className: classNames(className, motionClassName)\n    }));\n  }));\n};\nexport default /*#__PURE__*/memo(BackTop);"],"mappings":"AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,C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